clear
set more off
log using "\\file\UsersW$\wrr15\Home\My Documents\My Files\ATANDA AKINWANDE\BCD PAPER\HEALTH ECONOMICS revision\NEW DATA AND PROGRAMS (20171021)\TABLE2&3.smcl", replace
use "\\file\UsersW$\wrr15\Home\My Documents\My Files\ATANDA AKINWANDE\BCD PAPER\HEALTH ECONOMICS revision\NEW DATA AND PROGRAMS (20171021)\BCD_dataset_09_11_2017", clear

sort country year
xtset cid year
replace lhl = log(lhl)


///////////////////////////////////////////////
///////////////////  TABLE 2 //////////////////
///////////////////////////////////////////////

reg lhl lprod k pop14 pop65 male llex linfmo, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest
reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest
reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc gdpg, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg lhl lprod k pop14 pop65 male llex linfmo  i.year i.cid, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest
testparm i.year i.cid

reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc  i.year i.cid, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest 
testparm i.year i.cid

reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc gdpg i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest


reg lhl lprod k pop14 pop65 male llex linfmo cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 2.cid#c.year  3.cid#c.year  4.cid#c.year  5.cid#c.year  ///
         6.cid#c.year  7.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  15.cid#c.year  ///
		 16.cid#c.year  17.cid#c.year  18.cid#c.year  19.cid#c.year    ///
		 21.cid#c.year  22.cid#c.year  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 4.cid#c.year  5.cid#c.year  6.cid#c.year  8.cid#c.year  ///
         9.cid#c.year  10.cid#c.year  11.cid#c.year  12.cid#c.year  ///
		 13.cid#c.year  14.cid#c.year  17.cid#c.year  18.cid#c.year ///
		 19.cid#c.year  24.cid#c.year  25.cid#c.year  26.cid#c.year ///
		 27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg lhl lprod k pop14 pop65 male llex linfmo ltobaco lalcohc gdpg cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 4.cid#c.year  5.cid#c.year  6.cid#c.year  8.cid#c.year  ///
         9.cid#c.year  10.cid#c.year  11.cid#c.year  12.cid#c.year  ///
		 13.cid#c.year  14.cid#c.year  17.cid#c.year  18.cid#c.year ///
		 19.cid#c.year  24.cid#c.year  25.cid#c.year  26.cid#c.year ///
		 27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest




///////////////////////////////////////////////
///////////////////  TABLE 3 //////////////////
///////////////////////////////////////////////

reg phpnh prod pop14 pop65 male lex infmo, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc gdpg, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest


reg phpnh prod pop14 pop65 male lex infmo  i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc  i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest 

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc gdpg i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 3.cid#c.year  5.cid#c.year  ///
         6.cid#c.year  7.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  15.cid#c.year  ///
		 16.cid#c.year  17.cid#c.year  19.cid#c.year    ///
		 21.cid#c.year  22.cid#c.year  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 6.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  ///
		 17.cid#c.year  19.cid#c.year    ///
		  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg phpnh prod pop14 pop65 male lex infmo tobaco alcohc gdpg cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 6.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  ///
		 17.cid#c.year  19.cid#c.year    ///
		  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest


///////////////////////////////////////////////
///////////////////  TABLE 3 PLUS k //////////////////
///////////////////////////////////////////////

reg phpnh prod k pop14 pop65 male lex infmo, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc gdpg, vce(cluster cid)
display e(r2_a)
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo  i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc  i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest 

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc gdpg i.year i.cid, vce(cluster cid)
display e(r2_a)
testparm i.year i.cid
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 1.cid#c.year  2.cid#c.year  3.cid#c.year  4.cid#c.year  5.cid#c.year  ///
         6.cid#c.year  7.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  15.cid#c.year  ///
		 16.cid#c.year  17.cid#c.year  18.cid#c.year  19.cid#c.year  20.cid#c.year  ///
		 21.cid#c.year  22.cid#c.year  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 1.cid#c.year  2.cid#c.year  3.cid#c.year  4.cid#c.year  5.cid#c.year  ///
         6.cid#c.year  7.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  15.cid#c.year  ///
		 16.cid#c.year  17.cid#c.year  18.cid#c.year  19.cid#c.year  20.cid#c.year  ///
		 21.cid#c.year  22.cid#c.year  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

reg phpnh prod k pop14 pop65 male lex infmo tobaco alcohc gdpg cid##c.year, vce(cluster cid)
display e(r2_a)
testparm cid##c.year
testparm 1.cid#c.year  2.cid#c.year  3.cid#c.year  4.cid#c.year  5.cid#c.year  ///
         6.cid#c.year  7.cid#c.year  8.cid#c.year  9.cid#c.year  10.cid#c.year  ///
		 11.cid#c.year  12.cid#c.year  13.cid#c.year  14.cid#c.year  15.cid#c.year  ///
		 16.cid#c.year  17.cid#c.year  18.cid#c.year  19.cid#c.year  20.cid#c.year  ///
		 21.cid#c.year  22.cid#c.year  23.cid#c.year  24.cid#c.year  25.cid#c.year  ///
		 26.cid#c.year  27.cid#c.year  28.cid#c.year 
estat ic
estat ovtest

///Try this
///prais lhl prod pop14 pop65 male lex infmo tobaco alcohc gdpg cid##c.year, vce(cluster cid)


log close
